﻿using System;
using System.Collections.Generic;
using BIS.Portal.Modules.CMS.DAL;
using BIS.Portal.Modules.CMS.Entity;

namespace BIS.Portal.Modules.CMS.BO
{
    public class ClientCmsArticleBO
    {
        #region Properties
      
        public static string CategoryName
        {
            get { return ClientCmsArticleDAL.CategoryName; }
        }

        public static int ArticleCount
        {
            get { return ClientCmsArticleDAL.ArticleCount; }
        }

        #endregion
        /// <summary>
        /// Hiển thị tin nổi bật theo settings
        /// </summary>
        /// <returns></returns>
        public static IList<ClientCmsArticleAndCategoryEntity> GetArticleByHotArticle(int iIs_hot_articlet,
                                                                    int iLanguage_in_use_id, int iCategory_id,
                                                                    int iNumber_artcicle_display)
        {
            return ClientCmsArticleDAL.GetArticleByHotArticle(iIs_hot_articlet,iLanguage_in_use_id,iCategory_id,iNumber_artcicle_display);
        }
        /// <summary>
        /// Hiển thị tin tức mới theo settings
        /// </summary>
        /// <param name="iCategory_id"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iNumber_artcicle_display"></param>
        /// <returns></returns>
        public static IList<ClientCmsArticleAndCategoryEntity> GetArticleNewByDate(
                                                                    int iCategory_id,
                                                                    int iLanguage_in_use_id,
                                                                    int iNumber_artcicle_display)
        {
            return ClientCmsArticleDAL.GetArticleNewByDate(iLanguage_in_use_id,iCategory_id,iNumber_artcicle_display);
        }
        /// <summary>
        /// Hiển thị tin nổi bât đặc biệt
        /// </summary>
        /// <param name="iIs_hot_articlet"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="display_type_id"></param>
        /// <param name="iNumber_artcicle_display"></param>
        /// <returns></returns>
        public  static  IList<ClientCmsArticleAndCategoryEntity> GetArticleDisplayTypeByHot(int iIs_hot_articlet,
                                                                                 int iLanguage_in_use_id,
                                                                                  int display_type_id ,int iNumber_artcicle_display)
        {
            return ClientCmsArticleDAL.GetArticleDisplayTypeByHot(iIs_hot_articlet, iLanguage_in_use_id, display_type_id,
                                                                  iNumber_artcicle_display);
        }
        /// <summary>
        /// Hiển thị tin mới theo nhóm đặc biệt
        /// </summary>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="display_type_id"></param>
        /// <param name="iNumber_artcicle_display"></param>
        /// <returns></returns>
        public  static  IList<ClientCmsArticleAndCategoryEntity> GetArticleDisplayTypeOrderByDate(int iLanguage_in_use_id,
                                                                                  int display_type_id ,int iNumber_artcicle_display)
        {
            return ClientCmsArticleDAL.GetArticleNewDisplayTypeOrderByDate(iLanguage_in_use_id,display_type_id,iNumber_artcicle_display);
        }
        /// <summary>
        /// Lấy tin liên quan
        /// </summary>
        /// <param name="iCategory_id"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iNumber_artcicle_display"></param>
        /// <param name="iArticle_id"></param>
        /// <returns></returns>
        public static IList<ClientCmsArticleAndCategoryEntity> GetArticleDisplayRelated(int iCategory_id, int iLanguage_in_use_id,int iNumber_artcicle_display,int iArticle_id)
        {

            return ClientCmsArticleDAL.GetArticleDisplayRelated(iCategory_id,iLanguage_in_use_id,iNumber_artcicle_display,iArticle_id);
        }
        /// <summary>
        /// Lấy tin theo CategoryId
        /// </summary>
        /// <param name="iCategory_id"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iPage_index"></param>
        /// <param name="iNum_rows"></param>
        /// <returns></returns>
        public  static IList<ClientCmsArticleAndCategoryEntity> GetArticleByCategoryId(int iCategory_id, int iLanguage_in_use_id, int iPage_index,int iNum_rows)
        {
            return ClientCmsArticleDAL.GetArticleListDisplay(iCategory_id, iLanguage_in_use_id, iPage_index, iNum_rows);
        }
        /// <summary>
        /// Lấy tin tức chi tiết
        /// </summary>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iArticleId"></param>
        /// <returns></returns>
        public static ClientCmsArticleDetailsEntity GetArticleByArticleId(int iLanguage_in_use_id, int iArticleId)
        {
            return ClientCmsArticleDAL.GetArticleByArticleId(iLanguage_in_use_id, iArticleId);
        }
        /// <summary>
        /// Lấy danh sách tin tức theo tin tức chi tiết
        /// </summary>
        /// <param name="iArticle_id"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iNumber_rows"></param>
        /// <returns></returns>
        public static IList<ClientCmsArticleAndCategoryEntity> GetOtherArticleExcludeArcitcleDetails(int iArticle_id, int iLanguage_in_use_id, int iNumber_rows)
        {
            return ClientCmsArticleDAL.GetOtherArticleExcludeArcitcleDetails(iArticle_id, iLanguage_in_use_id,
                                                                             iNumber_rows);
        }
        /// <summary>
        /// Lấy tin tức liên quan theo Article_id
        /// </summary>
        /// <param name="iArticle_id"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iNumber_rows"></param>
        /// <returns></returns>
        public static IList<ClientCmsArticleAndCategoryEntity> GetListRelatedArticle(int iArticle_id, int iLanguage_in_use_id, int iNumber_rows)
        {
            return ClientCmsArticleDAL.GetListRelatedArticle(iArticle_id, iLanguage_in_use_id, iNumber_rows);
        }
        /// <summary>
        /// tim kiếm theo kyword ,theo ngày tháng va loại tin
        /// </summary>
        /// <param name="sKeyword"></param>
        /// <param name="dFrom_date"></param>
        /// <param name="dTo_date"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iPage_index"></param>
        /// <param name="iNumber_rows"></param>
        /// <param name="iCategory_id"></param>
        /// <returns></returns>
        public static IList<ClientCmsArticleAndCategoryEntity> GetArticleAdvanceSearch(string sKeyword, DateTime dFrom_date, DateTime dTo_date, int iLanguage_in_use_id, int iPage_index, int iNumber_rows, int iCategory_id)
        {
            return ClientCmsArticleDAL.GetArticleAdvanceSearch(sKeyword, dFrom_date, dTo_date, iLanguage_in_use_id, iPage_index, iNumber_rows, iCategory_id);
        }
        /// <summary>
        /// Lẫy media theo Article_id
        /// </summary>
        /// <param name="iArticle_id"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iMedia_type"></param>
        /// <param name="iPage_index"></param>
        /// <param name="iNumber_rows"></param>
        /// <param name="iCount"></param>
        /// <returns></returns>
        public static IList<ClientCmsMediaEnity> GetCmsMediaDetailByArticleId(int iArticle_id, int iLanguage_in_use_id, int iMedia_type, int iPage_index, int iNumber_rows,ref int iCount)
        {
            return ClientCmsArticleDAL.GetCmsMediaDetailByArticleId(iArticle_id, iLanguage_in_use_id, iMedia_type,
                                                                    iPage_index, iNumber_rows,ref iCount);
        }
        /// <summary>
        /// Lấy media enties select top 
        /// </summary>
        /// <param name="iArticle_id"></param>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iMedia_type"></param>
        /// <param name="iNumber_rows"></param>
        /// <returns></returns>
        public static IList<ClientCmsMediaEnity> GetCmsTopMediaEnitiesByArticleId(int iArticle_id, int iLanguage_in_use_id, int iMedia_type, int iNumber_rows)
        {
            return ClientCmsArticleDAL.GetCmsTopMediaEnitiesByArticleId(iArticle_id, iLanguage_in_use_id, iMedia_type,
                                                                        iNumber_rows);
        }
        /// <summary>
        /// Lấy danh sách Article không thuộc nhóm category nào
        /// </summary>
        /// <param name="iLanguage_in_use_id"></param>
        /// <returns></returns>
        public static IList<ClientCmsArticleFreeTextEntity> GetArticleFreeText(int iLanguage_in_use_id)
        {
            return ClientCmsArticleDAL.GetArticleFreeText(iLanguage_in_use_id);
        }
        /// <summary>
        /// lấy Article_content theo article free text
        /// </summary>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iArticle_id"></param>
        /// <returns></returns>
        public static ClientCmsArticleFreeTextEntity GetArticleContentFreeText(int iLanguage_in_use_id, int iArticle_id)
        {
            return ClientCmsArticleDAL.GetArticleContentFreeText(iLanguage_in_use_id, iArticle_id);
        }
        /// <summary>
        /// Lấy danh sách ảnh từ article ko thuộc nhóm category nào
        /// </summary>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iArticle_id"></param>
        /// <param name="iRow_top"></param>
        /// <returns></returns>
        public static IList<ClientCmsArticleFreeMediaEntity> GetFreeMediaByArticleId(int iLanguage_in_use_id, int iArticle_id, int iRow_top)
        {
            return ClientCmsArticleDAL.GetFreeMediaByArticleId(iLanguage_in_use_id, iArticle_id, iRow_top);
        }
        /// <summary>
        /// Lấy top 1 Article_id  theo category id
        /// </summary>
        /// <param name="iLanguage_in_use_id"></param>
        /// <param name="iCate_id"></param>
        /// <returns></returns>
        public static ClientCmsArticleIdByCategoryIdEntity GetArticleIdByCategoryId(int iLanguage_in_use_id,int iCate_id)
        {
            return ClientCmsArticleDAL.GetArticleIdByCategoryId(iLanguage_in_use_id, iCate_id);
        }
    }
}
